import { Resolver, Query, Args, Mutation } from '@nestjs/graphql';
import { CurrentUser } from '../common/decorators/currentUser';
import { AdminService } from './admin.service';
import { Admin } from './admin.entity';
import { UseGuards } from '@nestjs/common';
import { GqlAuthGuard } from '../common/guards/gql-auth.guard';

@Resolver('Admin')
export class AdminResolver {

  constructor(private readonly userService: AdminService){}
              // private readonly authService: AuthService) {}

  @UseGuards(GqlAuthGuard)
  @Query('currentAdmin')
  async currentUser(@CurrentUser() user: Admin) {
    console.log('currentUser')
    return user;
  }
}
